home *** CD-ROM | disk | FTP | other *** search
/ Kit PC World De Ampliacion De Windows 95 / Kit PC World de ampliacion de Windows 95.iso / clarion / gauge / gauge.z / CWDIALOG.CLW < prev    next >
Text File  |  1995-08-19  |  4KB  |  124 lines

  1. Dialog        PROGRAM
  2.  
  3.               INCLUDE('KEYCODES.CLW')
  4.  
  5.               MAP
  6.                 DisplayDialog
  7.                 INCLUDE('DDE.CLW')
  8.               END
  9.  
  10. OneShot       BYTE(0)
  11. Channel       LONG(0)
  12. Displays      SIGNED(25)
  13. Start         SIGNED
  14. Stop          SIGNED
  15. Duration      REAL
  16. DispsPerMin   STRING(10)
  17.  
  18. Window WINDOW('Clarion for Windows'),AT(0,0,306,97),SYSTEM,GRAY,MAX
  19.          STRING('Display Dialog Performance Test:'),AT(4,4,112,10)
  20.          STRING(@N7.1),AT(116,4,25,10),USE(DispsPerMin),RIGHT
  21.          STRING('Displays / Minute'),AT(144,4,,)
  22.          BUTTON('&Run'),AT(208,2,,),USE(?Run)
  23.          BUTTON('E&xit'),AT(248,2,,),USE(?Exit)
  24.        END
  25.  
  26.  CODE
  27.  OPEN(Window)
  28.  Window{PROP:Maximize} = True
  29.  Channel = DDESERVER('CWDIALOG')
  30.  ACCEPT
  31.    CASE EVENT()
  32.  
  33.    OF EVENT:DDEcommand
  34.      PRESSKEY(AltR)
  35.      OneShot = 1
  36.  
  37.    OF EVENT:Accepted
  38.      CASE FIELD()
  39.      OF ?Run
  40.        DO DisplayTest
  41.        IF OneShot THEN RETURN.
  42.  
  43.      OF ?Exit
  44.        RETURN
  45.      END
  46.    END
  47.  END
  48.  DDECLOSE(Channel)
  49.  
  50. DisplayTest ROUTINE
  51.   DISABLE(?Run,?Exit)
  52.   SETCURSOR(CURSOR:Wait)
  53.   Start = CLOCK()
  54.   LOOP UNTIL CLOCK() > Start.
  55.   Start = CLOCK()
  56.   LOOP UNTIL CLOCK() <> Start.
  57.   Start = CLOCK()
  58.   LOOP Displays TIMES
  59.     DisplayDialog
  60.   END
  61.   Stop = CLOCK()
  62.   Duration = (Stop - Start) / 100             !Calculate time used
  63.   DispsPerMin = Displays * 60 / Duration         !Calculate displays per minute
  64.   DISPLAY
  65.   SETCLIPBOARD(DispsPerMin)
  66.   ENABLE(?Run,?Exit)
  67.   SETCURSOR(CURSOR:Arrow)
  68.  
  69. DisplayDialog PROCEDURE
  70.  
  71. Name          STRING('John Smith')
  72. Address       STRING('1234 Main Street')
  73. City          STRING('Anywhere')
  74. State         STRING('USA')
  75. Zip           STRING('10000')
  76. HomePhone     DECIMAL(10,0,4443456789)
  77. WorkPhone     DECIMAL(10,0,4443455678)
  78. MaritalStatus STRING('Single')
  79. Dependents    DECIMAL(2,0,2)
  80. Recruiting    STRING('Advertisement')
  81. Nights        BYTE(1)
  82. Weekends      BYTE(1)
  83. FillIn        BYTE(1)
  84.  
  85. Dialog WINDOW('Personal Information'),AT(,,264,176),CENTER,SYSTEM,GRAY
  86.        PROMPT('&Name:'),AT(15,15,26,10)
  87.        ENTRY(@S25),AT(65,15,,10),USE(Name)
  88.        PROMPT('&Address:'),AT(15,30,,10)
  89.        ENTRY(@S25),AT(65,30,,10),USE(Address)
  90.        PROMPT('&City:'),AT(15,45,,10)
  91.        ENTRY(@S15),AT(65,45,,10),USE(City)
  92.        PROMPT('&State:'),AT(135,45,,10)
  93.        ENTRY(@S2),AT(160,45,15,10),USE(State)
  94.        PROMPT('&Zip:'),AT(185,45,,10)
  95.        ENTRY(@S5),AT(205,45,,10),USE(Zip)
  96.        PROMPT('&Home Phone:'),AT(15,60,,10)
  97.        ENTRY(@P(###)###-####P),AT(65,60,,10),USE(HomePhone)
  98.        PROMPT('&Work Phone:'),AT(135,60,,10)
  99.        ENTRY(@P(###)###-####P),AT(183,60,,10),USE(WorkPhone)
  100.        PROMPT('Marital Status'),AT(15,75)
  101.        LIST,AT(65,75,55,10),USE(MaritalStatus),DROP(4),FROM('Single |Married | Widowed | Divorced')
  102.        PROMPT('Dependents:'),AT(135,75,,10)
  103.        SPIN(@N2),AT(183,75,31,10),USE(Dependents)
  104.        OPTION('Recruiting'),AT(13,90,96,56),USE(Recruiting),BOXED
  105.          RADIO('Agency'),AT(22,102,,10),USE(?Agency)
  106.          RADIO('Advertisement'),AT(22,116,,10),USE(?Advertisement)
  107.          RADIO('Walk-in'),AT(22,130),USE(?WalkIn)
  108.        END
  109.        GROUP('Preferences'),AT(133,90,96,56),BOXED
  110.          CHECK('Nights'),AT(141,102,,10),USE(Nights)
  111.          CHECK('Weekends'),AT(141,116,,10),USE(Weekends)
  112.          CHECK('Fill-in'),AT(141,130,,10),USE(FillIn)
  113.        END
  114.        BUTTON('OK'),AT(72,155,,10),USE(?OK)
  115.        BUTTON('Cancel'),AT(140,155,,10),USE(?Cancel)
  116.      END
  117.  
  118.   CODE
  119.   OPEN(Dialog)
  120.   ACCEPT
  121.     BREAK
  122.   END
  123.   CLOSE(Dialog)
  124.